<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>放飞科技</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/news.css">
    <link rel="stylesheet" href="../../css/modal.css">
    <style>
        .modal .container .content {
            margin: 0 24px;
            /* margin-bottom: 4vw; */
            width: calc(100% - 48px);
            padding: 10px;
            box-sizing: border-box;
            border-radius: 10px;
            overflow: visible;
            height: auto;
        }

        .title {
            font-size: 16px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #808080;
        }

        .person {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 0;
        }

        .person .pt {
            width: 22%;
            text-align: center;
            border: 1px solid;
            color: #B3B3B3;
            padding: 6px 0;
            border-radius: 30px;
            box-sizing: border-box;
        }

        .person .pt.active {
            background: linear-gradient(-13deg, #E63BE4, #FF82CC);
            border-radius: 50px;
            color: #fff;
            border: none;
        }

        .input {
            background: #f3f3f3;
            padding: 10px;
            border-radius: 5px;
        }

        .input input {
            width: 100%;
        }
    </style>
</head>

<body>
    <div id="view" v-cloak>
        <div class="modal-bg" onclick="_close()">
            <div class="modal" @click.stop>
                <img class="img-bg" src="../../image/modal/tcsp.png" alt="">
                <div class="container">
                    <div class="content">
                        <div class="title">速配人数(1金币/人)</div>
                        <div class="person">
                            <div class="pt" @click="membercount = 1" :class="{active: membercount == 1}">1人</div>
                            <div class="pt" @click="membercount = 3" :class="{active: membercount == 3}">3人</div>
                            <div class="pt" @click="membercount = 5" :class="{active: membercount == 5}">5人</div>
                            <div class="pt" @click="membercount = 10" :class="{active: membercount == 10}">10人</div>
                        </div>
                        <div class="input">
                            <input type="text" placeholder="请输入您想广播的话" v-model="content">
                        </div>
                    </div>
                    <div class="flex-c">
                        <button class="modal-btn" onclick="submit()">开始匹配</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/jquery.js"></script>
<script src="../../script/ffkj.js"></script>
<script src="../../script/vue.js"></script>
<script>
    var view = new Vue({
        el: '#view',
        data: {
            membercount: 1,
            imgurl: imgurl,
            ffList: [],
            ffInfo: {},
            ios: 1, // 1上架 0非上架
            content: ''
        },
        methods: {
            // 跳转
            _url(param, url) {
                _url(param, url);
            },
            // 返回图片路径
            returnImg(url) {
                return returnImg(url);
            },
        }
    })
    apiready = function() {}


    // 
    function _close() {
        api.closeFrame();
    }

    // 开始匹配
    function submit() {
        if (!view.content) {
            _msg('请输入您想广播的话')
            return;
        }
        _ajax('api/privatechat/greet', function(ret, err) {
            if (ret && ret.code == 400) {
                _msg(ret.msg);
            } else {
                _msg('成功');
                setTimeout(function() {
                    _close()
                }, 1000)
            }
        }, {
            user_id: $api.getStorage('userid'),
            speed: view.membercount,
            content: view.content
        })
    }
</script>

</html>